<?php

namespace app\admin\controller;
use app\common\controller\Admin;
class Category extends Admin
{

    public function _initialize() {
        parent::_initialize();
    }
    public function getcategory($model,$type=null) {
        if($type){
            $map['name']=$type==1?"男频":"女频";
        }
        $map['model_id'] = $model;
        $list = db('Category')->where($map)->order('sort asc,id asc')->column('id,title');
        echo json_encode(array("code"=>1,"data"=>$list));
    }
}